<?php
/**
 * Description: 描述
 * Created by PhpStorm.
 * User: congyukun
 * Date: 2021/3/15
 * Time: 15:17
 */

namespace Biz\model\brandActivity;


use Doraemon\pockets\datebase\BaseDbModel;

class BrandShowActivity extends BaseDbModel
{
    public const _CONFIG_FILE_ = 'db_store';
    
    public const _CONFIG_SELECT_ = 'db_brand_activity';
    
    public const _DATABASE_ = 'brand_activity';
    
    public const _TABLE_NAME = 'brand_show_activity';
    
    public const _SUB_TABLE = false;
    
    public const STATUS_NORMAL = 1;
    
    public const STATUS_STOP = 2;
    
    /**
     * 根据搜索条件获取正常状态
     * @param $where
     * @param string $filed
     * @return array|bool
     */
    public static function getInfoByWhere($where, $filed = '*')
    {
        $where['s_status'] = self::STATUS_NORMAL;
        return self::get($filed, $where);
    }
    
    /**
     * 获取一条
     * @param $where
     * @param string $filed
     * @return array|mixed
     */
    public static function is_have($where, $filed = 'id'): array
    {
        $where['s_status'] = self::STATUS_NORMAL;
        return self::select($filed, $where);
    }
    
    /**
     * 获取所有正在参加活动的品牌
     * @param string $filed
     * @return array|bool
     */
    public static function getAllNormalBrandIds($filed = "*")
    {
        $where['s_status'] = self::STATUS_NORMAL;
        return self::select($filed, $where);
    }
}